package com.ywu.standard.menu.data;

import com.ywu.standard.menu.dto.MenuDto;
import com.ywu.standard.menu.dto.MenuPermissionDto;
import com.ywu.standard.menu.dto.search.MenuSearchDto;
import com.ywu.standard.menu.entity.MenuEntity;
import com.ywu.standard.menu.entity.MenuPermissionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

@Mapper
public interface MenuRepository {

    List<MenuEntity> queryAllMenu(@Param("model") MenuDto menuDto);

    List<MenuEntity> queryList(@Param("model") MenuSearchDto menuSearchDto);

    List<MenuEntity> queryTenantAndPermissionList(@Param("tenantId") String tenantId, @Param("list") List<String> roleCodes);

    void addMenu(@Param("model") MenuDto menuDto);

    MenuEntity queryOne(@Param("model") MenuSearchDto menuSearchDto);

    void updateMenu(@Param("model") MenuDto menuDto);

    void deleteById(@Param("id") Integer id);

    MenuEntity checkMenuEntity(@Param("model") MenuSearchDto dto);

    List<MenuPermissionEntity> queryMenuPermission(@Param("model") MenuPermissionDto menuPermissionDto);

    MenuEntity queryMenuByRouteTo(@Param("model") MenuDto menuDto);

    List<MenuEntity> queryAllMenuInfo();

    List<MenuEntity> getEntityListByRouteTo(@Param("list") List<String> routeTo);

    void updateMenuIsHidden(@Param("model") MenuDto menuDto);

    List<MenuEntity> queryMenuByCurrentPermission(@Param("list") Set<String> userRoleCodes);

    List<MenuEntity> queryByComponentId(@Param("componentId") Integer componentId);
}
